import router, { resetRouter } from "./router";
import store from "./store";
import { Message } from "element-ui";
import NProgress from "nprogress"; // progress bar
import "nprogress/nprogress.css"; // progress bar style
import { getCookie, getStore } from "@/utils/auth"; // get token from cookie
import getPageTitle from "@/utils/get-page-title";

NProgress.configure({ showSpinner: false }); // NProgress Configuration
// const whiteList = ['/login','/centerDetails'] // no redirect whitelist
const whiteList = ["/login", "/"]; // no redirect whitelist
router.beforeEach(async (to, from, next) => {
  if (to.matched.length == 0) {
    next("/edge");
  } else {
    next();
  }
});

router.afterEach(() => {
  // finish progress bar
  NProgress.done();
});
